<?php
namespace jy_weishop;
defined('BY_JYA') or exit('error');
/*
	商户
*/
class merch extends \plugin{
	public function up($merchid){
		//更新足迹
		$history=pdo_getcolumn('jy_weishop_member_history',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'merchid'=>$merchid),'id');
		if($history){
			pdo_update('jy_weishop_member_history',array('createtime'=>time()),array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'merchid'=>$merchid));
		}else{
			pdo_insert('jy_weishop_member_history',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'merchid'=>$merchid,'createtime'=>time()));
		}
	}
	public function get($params,&$total=null){
		if(!$params['orderby']){
			$params['orderby']=array('id desc');
		}
		$list=$this->pdo_getlist('member_history',$params,$total);
		return $list;
	}
	
}